﻿using System.Web.Mvc;

using AttributeRouting;
using AttributeRouting.Web.Mvc;
using PH.Logic.Analyses;
using PH.Model.Analyses.Schools;
namespace PH.Web.Management.Areas.Portal.Controllers
{
    [RouteArea("Portal")]
    [RoutePrefix("Student")]
    public class StudentController : Controller
    {
        [Route("Login")]
        public ActionResult Login() {
            return View();
        }

        [Route("Search")]
        public ActionResult Search()
        {
            return View();
        }

        [Route("Result/{studentno}")]
        public ActionResult Result(string studentno)
        {
            var lst = new S4StudentCollection();
            for (var i = 0; i < 2; i++)
            {
                var temp = SchoolLogic.GetS4Student(studentno.Trim(), i == 1);
                lst.AddRange(temp);
                lst.TotalRecordsCount += temp.TotalRecordsCount;
            }
            return View(lst);
        }
    }
}
